<template>
  <button class="button" @click="countDown">
    {{content}}
  </button>
</template>

<script>
export default {
  name: 'TimeBtn',
  data () {
    return {
      content: '获取',
      total: 60
    }
  },
  methods: {
    countDown () {
      let clock = window.setInterval(() => {
        this.total--
        this.content = this.total + 's后重新发送'
      }, 1000)
    }
  }
}
</script>

<style lang="stylus" scoped>
  .button
    background #409EFF
    width 65px
    height 40px
    border-radius 10px
    color #fff
</style>
